#ifndef VISUALIZE_SURFACEMESH_H
#define VISUALIZE_SURFACEMESH_H

#include <cuda.h>
#include <cuda_runtime.h>
#include "GLCapture.hpp"
#include <GL/glut.h>
#include <opencv2\opencv.hpp>

class PlaneFitting_FVI;
class Visualizer;

class VisualizeSurfaceMesh{
public:
	VisualizeSurfaceMesh();
	~VisualizeSurfaceMesh();
	void			Process(int argc, char** argv);
private:
	static const int			WindowNum;
	static int*					WindowID;
	static PlaneFitting_FVI*	FVI;
	static GLuint				_textureId; //The id of the texture
	static void					handleKeypress(unsigned char key, int x, int y);
	static GLuint				loadTexture(const cv::Mat_<cv::Vec3b> image);
	static void					initRendering();
	static void					handleResize(int w, int h);
	static void					renderOutputTexture();
	static void					renderInputTexture();
	static void					renderSegmentedTexture();
	static void					idle();
	static float3				ViewPoint;
	static float3				ViewAngle;
	static const float			MaxMeshSize;
	static GLCapture			Capture1;
	static GLCapture			Capture2;
	static GLCapture			Capture3;
	static cv::VideoWriter		Writer;
	static cv::Mat_<cv::Vec3b>  SegmentedImage;
	static Visualizer*			Visual;
	//static inline float 		distance3D(const float3& pointA, const float3& pointB)const{return fabs(pointA.z - pointB.z);}
};


#endif